package threads;

/**
 * @author apple
 * @Classname ThreadTask
 * @Description 线程的具体任务
 * @Date 2020/4/19 17:57
 */
public class ThreadTask implements Runnable{
    private int count;

    /**传递进来的参数，只要setter**/
    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public void run() {
        int sum = 0;
//        int count =1000;
        for(int i=0;i<count;i++){
            sum += i;
        }
        System.out.println(System.currentTimeMillis()+"="+ Thread.currentThread()+" sum ="+sum);
    }

}
